#include "ti_msp_dl_config.h"
#include "oled.h"
#include "Motor.h"
#include "Huidu.h"
#include "PID.h"
#include "JY901S.h"
#include "Delay.h"

#ifndef __Variables_H
#define __Variables_H
//----------------MAIN  BEGIN ---------------------------//
extern char cmd; 
//----------------HUIDU.C  BEGIN ---------------------------//
extern int32_t Encoder_Count_Left;          //位移值左轮
extern int32_t Encoder_Count_Right;         //位移值右轮
extern int32_t Encoder_Count_Left_temp;     //位移值左轮--用于速度计算
extern int32_t Encoder_Count_Right_temp;    //位移值右轮--用于速度计算
extern int32_t Gray_Error;            //灰度差值
extern uint8_t flag_stop;             //禁止状态转换
//----------------TIMER0.C  BEGIN ---------------------------//
extern uint32_t test_num;                   //测试值
extern int32_t Left_speed;
extern int32_t Right_speed;
extern int32_t Left_speed_pid;     //左轮速度环的值
extern int32_t Right_speed_pid;    //右轮速度环的值
extern int32_t Left_Angle_pid;     //左轮角度环的值
extern int32_t Right_Angle_pid;    //右轮角度环的值
extern int32_t Left_Distance_pid;     //左轮位移环的值
extern int32_t Right_Distance_pid;    //右轮位移环的值
extern int32_t last_left_speed_pid;    //左轮上次的速度值
extern int32_t last_right_speed_pid;   //右轮上次的速度值
extern uint8_t Curr_State;            //状态            
extern uint8_t Last_State ;      //状态
extern uint8_t Circle_Cnt;

extern uint8_t Tishi_flag;
extern uint16_t Speed_goal;
extern uint8_t Error_less_flag;
//----------------JY901S  BEGIN ---------------------------//
extern volatile float yaw_angle;
//---------------PID   BEGIN-----------------------------//
extern PID Speed_Left;
extern PID Speed_Right;
extern PID Angle;
extern PID Distance_Left;
extern PID Distance_Right;
extern PID Gray;
extern PID Xiexian_Angle;
#endif